<template>
  <p>子组件1--用户姓名--{{ name }}</p>
  <p>子组件1-展示用户信息--{{ userInfo }}</p>
  <el-button @click="changeUserAge">子组件1修改父组件数组</el-button>
</template>
<script setup>

const props = defineProps({
  name: {
    type: String,
    default: "",
  },
  userInfo: {
    type: Object,
    default: () => {
      return {}
    },
  },
})

const emit = defineEmits(["changeUserAge"])

function changeUserAge() {
    emit("changeUserAge",Math.floor(Math.random()*100))
}
</script>
